package cn.hchaojie.boot.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.hchaojie.boot.mapper.ArchiveMapper;
import cn.hchaojie.boot.service.ArchiveService;

@Service
public class ArchiveServiceImpl implements ArchiveService {
	@Autowired
	private ArchiveMapper mapper;
	
	@Override
	@Transactional
	public void delete() {
		mapper.deleteByPrimaryKey(11);
		
		// 抛异常
		System.out.println(1 / 0);
		
		mapper.deleteByPrimaryKey(12);
	}
}
